import os

from pydantic_settings import BaseSettings
from pydantic import Field


class Settings(BaseSettings):
    # 最大工作线程
    MAX_WORKER: int = Field(default=1, lt=max(os.cpu_count() or 1 - 2, 1), description="最大工作线程")

    class Config:
        # 指定.env文件路径
        env_file = ".env"
        env_file_encoding = "utf-8"
        # 忽略环境变量大小写
        case_sensitive = False


settings = Settings()
